home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
EXTRACT.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
2KB
|
56 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_Extract( cStr, cDelim, nOccurance ) --> cString
PARAMETERS:
cStr : String to extract characters from
cDelim : The delimiter character or string
nOccurance : The nth occurance to extract
SHORT:
Extract nth occurance of delimited string from another string.
DESCRIPTION:
_Extract() will extract from cStr the nth string (specified in nOccurance)
delimited with the specified delimiter (specified in cDelim).
END OF STRING ALWAYS = DELIMIT CHAR
The end of the string will always count as a match of the delimiter
character. That is, the string delimited by the 4th occurance of the
delimiter "/" in the following string is "FOUR" even though there is no
actual fourth occurance of the forward slash:
_Extract("ONE/TWO/THREE/FOUR", '/', 4)
The FIRST occurance of the delimiter character delimits "ONE", the second
"TWO" etc etc.
NOTE:
The FIRST delimited text cannot be empty(),
i.e. _Extract('A-B-C-D', '-', 3) will work
i.e. _Extract('-B-C-D', '-', 3) will NOT work
Make sure there is no leading delimiter character in the string you
are testing as in the above case ",B,C,..."
EXAMPLE:
To extract the THIRD number in a series of numbers in a character
string delimited with commas:
t = _Exctract('12,34,56,74',',',3)
Result: t = 56
******************************************************************************/